<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" name="username" id="b" autofocus value="frank" mydata="aaaa">

<script>
    var obj1 = document.getElementById('b')
    console.log(obj1.type);
    console.log(obj1.autofocus);

    console.log(obj1.getAttribute('type'));
    console.log(obj1.getAttribute('mydata'));



    obj1.type = 'text';//password

    obj1.setAttribute('mydata','bbbb');








</script>
</body>
</html>